package Interface;

import org.junit.Test;

import java.util.function.Consumer;

/**
 * Consumer<T>:消费型接口
 * void accept(T t);
 */
public class TestConsumer {
    @Test
    public void test() {
        happy(10000, (m) -> System.out.println("消费金额" + m + "元"));
    }

    public void happy(double moneny, Consumer<Double> con) {
        con.accept(moneny);
    }
}
